package cc.z8g.browser.search

import androidx.annotation.StringRes
import cc.z8g.browser.R

/**
 * 根据query url选择搜索引擎
 */
open class BaseSearchEngine(val queryUrl: String, @StringRes val titleRes: Int) {
    operator fun component1() = queryUrl

    operator fun component2() = titleRes
}

class CustomSearch(queryUrl: String) : BaseSearchEngine(queryUrl, R.string.search_engine_custom)
class BingSearch : BaseSearchEngine("https://www.bing.com/search?q=", R.string.search_engine_bing)
class GoogleSearch : BaseSearchEngine("https://www.google.com/search?ie=UTF-8&oe=UTF-8&q=", R.string.search_engine_google)
class BaiduSearch : BaseSearchEngine("https://www.baidu.com/s?wd=", R.string.search_engine_baidu)





